package net.wanho.controller;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author：汤小洋
 * Date：2024-08-12 14:06
 * Description：<描述>
 */
@RestController
@Slf4j // lombok注解，自动创建log对象
public class HelloController {

    // Logger log = LoggerFactory.getLogger(HelloController.class);

    @GetMapping("/hello")
    public String hello() {

        log.info("info信息，执行了hello方法。。。。。。");

        return "hello";
    }

    @GetMapping("/world")
    public String world() {

        log.error("error消息，执行word时出现错误。。。。。。");

        return "world";
    }
}
